﻿using STHPMS1.ICore.I_Entity.Info;
using STHPMS1.ICore.I_Entity.Stmpms1;
using STHPMS1.ICore.I_Serv;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Data;

namespace STHPMS1.ICore.I_BLL.Bus
{
    public interface IB_InvntoryBill : IBll
    {
        DataTable GetOrderByList(string rdwayid, int dir);
        void Save<T>(T entity) 
            where T:class ,IB_Invntory;

        void Remove(IB_Invntory entity);

        IEnumerable<T> Get<T>(Expression<Func<T, bool>> predicate, IPagingInfo info)
            where T : class, IB_Invntory;
        /// <summary>
        /// 根据路段划分标准，划分路段，并保存结果
        /// </summary>
        /// <param name="standard"></param>
        void DivideRoad(string rdwayid, int? direction_Dictid = null);
        /// <summary>
        /// 获取路线的路段划分结果
        /// </summary>
        /// <returns></returns>
        System.Data.DataTable GetRoadDivisionResult(IPagingInfo info);

        int GetRdclass_Dictid(string unit);

        int GetRirection_Dictid(string unit);

        string GetSegID(string unit);

        IEnumerable<IB_Invntory> GetSeg(string rdwayid, int? direction_id, IPagingInfo info);
        IEnumerable<IB_Unit> GetUnit(string rdwayid, int? direction_id, IPagingInfo info);

        /// <summary>
        /// 根据路网id查找所有路段Id
        /// </summary>
        /// <param name="rdwayid"></param>
        /// <returns></returns>
        List<string> List(string rdwayid);

        /// <summary>
        /// 根据路网ID和方向查询路段信息，并按结束桩号排序
        /// </summary>
        /// <param name="rdwayid">路段ID</param>
        /// <param name="dir">方向</param>
        /// <returns></returns>
        IEnumerable<T> GetOrderByList<T>(string rdwayid, int dir) where T : class, IB_Invntory;

        /// <summary>
        /// 根据路网ID查询所有路段信息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="rdwayid"></param>
        /// <returns></returns>
        List<T> GetList<T>(string rdwayid) where T : class, IB_Invntory;

        /// <summary>
        /// 根据测点桩号，行车方向，路线编号返回路段
        /// </summary>
        /// <param name="fwdmp"></param>
        /// <param name="dir"></param>
        /// <param name="rdid"></param>
        /// <returns></returns>
        string GetSegId(double fwdmp, int dir, string rdid);
    }
}
